#include <iostream>
#include <jsoncpp/json/json.h>

using namespace std;

int main()
{
    Json::Value root;

    root["x"] = 100;
    root["y"] = 200;
    root["op"] = '+';
    root["dest"] = "this is a oper";

    Json::FastWriter w;
    // Json::StyledWriter w;
    string res = w.write(root);
    cout << res << endl;

    Json::Value v;
    Json::Reader r;
    r.parse(res, v);

    int x = v["x"].asInt();
    int y = v["y"].asInt();
    char op = v["op"].asInt();
    string dest = v["dest"].asString();

    cout << x << endl;
    cout << y << endl;
    cout << op << endl;
    cout << dest << endl;


    return 0;
}